<?php

namespace App\Providers;

use OSS\OssClient;
use Illuminate\Support\ServiceProvider;

class OssServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register()
    {
        $this->app->singleton('oss', function () {
            $accessKeyId = env('OSS_ACCESS_KEY_ID');
            $accessKeySecret = env('OSS_ACCESS_KEY_SECRET');
            $endpoint = env('OSS_ENDPOINT');
            $bucket = env('OSS_BUCKET');

            return new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
        });
    }

    /**
     * Bootstrap any application services.
     */
    public function boot()
    {
    }
}
